version: '3.7'

services:
  test:
    command: npm run test
    build:
      context: ./
      dockerfile: ./docker/test.dockerfile
    depends_on:
      - database
    restart: "no"
    image: ydb-orm:test
    environment:
      - NODE_ENV=test

      - YDB_ENDPOINT=grpc://database:2136
      - YDB_DATABASE=/local

      - YDB_CERTS=/ydb_certs
    volumes:
      - ydb_certs:/ydb_certs
    networks:
      - local

  database:
    image: cr.yandex/yc/yandex-docker-local-ydb:latest
    hostname: database
    environment:
      - YDB_USE_IN_MEMORY_PDISKS=true
      - YDB_DEFAULT_LOG_LEVEL=WARN
      - GRPC_TLS_PORT=2135
      - GRPC_PORT=2136
      - MON_PORT=8765
    restart: "no"
    volumes:
      - ydb_certs:/ydb_certs
    networks:
      - local

networks:
  local:
    driver: bridge

volumes:
  ydb_certs:
